Smart Electrical Wheel for Electrical Bikes

ABSTRACT

A wheel assembly having a motor attached to a hub within the wheel assembly such that the motor powers the wheel assembly to rotate about an axle once the motor receives a predetermined amount of power. A battery system is configured to deliver power to said motor, the battery system is arranged to rotate with the wheel assembly. A sensor system within the wheel assembly provides data related to velocity and angle of orientation of the assembly. A control system within the wheel assembly receives data related to velocity and angle of orientation of the wheel assembly from the sensor system, with the control system having at least one output to from the battery system indicative of an amount of power that is delivered to the motor.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention pertains to hybrid bicycles and, moreparticularly, to retrofitting conventional bicycles to convert them tohybrid bicycles.

2. Description of the Prior Art

Numerous electrically powered bicycles and hybrid bicycles currentlyexist within the marketplace. Hybrid as used herein refers to bicyclesor vehicles that are powered using multiple power sources. A hybridbicycle, as used herein, refers to bicycles that have an electricalpower source plus at least one other power source.

Kits are currently available that can be used to retrofit conventional,manually powered bicycles into either electrically powered or hybridpowered bicycles. These kits typically provide electrically poweredwheels or parts that convert conventional wheels into electricallypowered wheels. Currently available kits have hardware distributedthroughout various parts of the bike.

An example of one type of currently available kit for the retrofittingof conventional bicycles to create electrical or hybrid bicycles,requires users to assemble batteries somewhere on the bicycle frame andto install controllers of some type on the handle bar so the user cancontrol the electrical power to the motor. The assembly of these kitstakes time and some customers are discouraged with the time needed aswell as the technical expertise and tools required to complete theassembly.

There remains a need for assemblies that can retrofit conventionalbicycles to create hybrid, or electrical bicycles, that do not requiresignificant user assembly or have numerous parts distributed on variousareas of the bicycle.

SUMMARY OF THE INVENTION

Embodiments described herein discuss the design of an electrical bicyclewheel and algorithms used to control electrical bicycle wheel.

Other embodiments disclose algorithms and combination of sensors withinan electrical wheel that control power to an electric or hybrid bicyclewithout the need for user input.

Additional embodiments described herein discuss an electrical bicyclewheel having all the hardware components incorporated inside a frontwheel assembly.

Still additional embodiments described herein discuss an electricalbicycle wheel that employs an accelerometer to control the electricalpower of the bicycle

Other embodiments detail a wheel that is a single assembly that can beused to retrofit bicycles to create a hybrid bicycle.

Another embodiment provides an electrical front wheel assemblycontaining all the hardware necessary to retrofit a conventional bicycleto create a hybrid bicycle without any tools for conventional bicyclesthat have a quick release skewer.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a cut away, perspective view of an embodiment for anelectrical bicycle wheel;

FIG. 2 a functional block diagram for the determination of outputvoltage applied to the wheel motor;

FIG. 3 is a flow chart of the operation for the electrical bicycle wheelshown in FIG. 1;

FIG. 4 is a flow chart for calculation of the velocity of electricalbicycle wheel in FIG. 1;

FIG. 5 is a flow chart for the calculation of the angle of theelectrical bicycle wheel shown in FIG. 1.

DETAILED DESCRIPTION

FIG. 1 is an illustration of an embodiment for a bicycle front wheelassembly 10 that provides power using only elements contained within thewheel assembly 10. Wheel assembly 10 is powered by motor 12 that mountedaround central axle 8. The wheel assembly has tire 4 and cover 2. Cover2 exists on both sides of wheel assembly 10 but is removed from theviewing side to allow the interior portions of the wheel assembly to beseen.

The wheel assembly 10 rotates about axle 8. An example of a motor thatcan be used for motor assembly 12 within wheel assembly 10 is a 24 volt,250 watt motor manufactured by Jia-Yu.

In an embodiment, a control mechanism is supplied outside the wheelassembly 10 to allow a user to increase or power supplied by wheelassembly 10. The user will use the control mechanism to command power tothe motor 12.

In another embodiment, there is no user control mechanism and the wheelassembly is provided with sufficient intelligence to operate withoutuser control or input. The electrical wheel assembly 10 is designed withsufficient intelligence such that no user input is required.Accordingly, no user control mechanism, either on the handle bar oranywhere on the bicycle, is required. The electronics within the wheelassembly 10 makes decisions regarding the amount of power to be suppliedto the electrical motor.

In embodiments that do not require user input or control, algorithms andcombinations of sensors in the wheel assembly 10 are employed to controlvoltages applied to the motor 12.

In another embodiment employs wheel assembly 10 as a replacement of aconventional bicycle front wheel. The wheel assembly 10 is a smartelectrical wheel designs that makes retrofitting on a conventionalbicycle with wheel assembly 10 a trivial task. In this embodiment, thesmart electrical wheel assembly 10 contains all the necessary hardwareto provide power to drive a bicycle. Included within the wheel assembly10 are batteries, controllers, cables incorporated inside. The wheelassembly is placed in use by simply replacing the front wheel onconventional bicycle with wheel assembly 10. The conventional bicycleretrofitted with wheel assembly 10 then becomes a hybrid bicycle withmanner power applied in a conventional manner and electric power appliedthrough wheel assembly 10.

In an embodiment, electrical wheel assembly 10 may include multipletypes of sensors. These sensor types may include accelerometers,encoders in or associated with the motor 12 that measures the angularposition of the motor 12 with respect to the ground, and strain gages inone or more spokes 24.

Power for motor 12 is provided by battery assembly 22. Battery assembly22 is an assembly that contains connections for several batteries. In anembodiment, the battery assembly can rotate with wheel assembly 10. Thebattery assembly 22 illustrated in FIG. 1 contains batteries dispersedcircumferentially around axle 8 such that the battery assembly 22 canrotate with wheel assembly 10. Controller 6 receives signals from maincircuit board 16 regarding the amount of power the motor 12 shouldreceive from battery system 22. A DC power connection (not shown) isprovided to recharge the battery system 22.

An embodiment for battery assembly 22 employs 20 D-size, rechargeablebatteries. An example of a rechargeable battery that can be used areD-size, rechargeable batteries from NEXcell®. It should be noted thatnumerous types of batteries can be used within battery assembly 22 andbattery assemblies can be made that contain more or fewer than 20batteries. It should be noted that additional assemblies for providingbattery power are envisioned that do not contain batteries dispersedcircumferentially around axle 8 or that do not rotate with wheelassembly 10.

The wheel assembly 10 illustrated in FIG. 1 may employ various sensors.One type of sensor that may be employed is an accelerometer 14 thatprovides sensor data indicative of the motion of the wheel assembly. Anexample of a satisfactory accelerometer 14 is the FreescaleKIT3376MMA7341L that provides a three axis analog output. Accelerometer14 is attached to one of spokes 24 and rotates with wheel assembly 10.Analog sensor data from accelerometer 14 is input into main circuitboard 16. The analog sensor data from accelerometer 14 can be convertedto digital sensor data on main circuit board 16. While accelerometer 14rotates with the Wheel assembly 10, embodiments are envisioned havingaccelerometers that do not rotate with wheel assembly 10 but insteadremain in a fixed position relative to axle 8.

An example of an available circuit board that can provide the functionsrequired by main circuit board 16 is the RABBIT BL4S200, or the like. Inan embodiment using the RABBIT BL4S200, the processor contained thereoncan perform a Fast Fourier Transform (FFT) of the digital sensor datafrom the accelerometer 14. Embodiments can have the processor performmathematical operations on the digital sensor data from accelerometer 14in real time. The processor on a RABBIT BL4S200 is sufficiently fast toperform these operations in real time.

Other embodiments can implement, a Look Up Table (LUT) within memorycontained in the main circuit board 16. The RABBIT BL4S200 containsflash memory that can provide LUT functionality. The sensor data fromthe accelerometer 14 can be converted from time domain to frequencydomain by an FFT and placed within an LUT. The LUT can be read toprovide the angle at which wheel assembly 10 currently exists.

Another sensor that may be used within wheel assembly 10 is an encoder18 that functions to provide data relative to the linear velocity of thewheel assembly 10. Encoder 18 may be a rotary encoder having one partthat does not rotate with wheel assembly 10 and another part that doesrotate with wheel assembly 10. To determine the linear velocity ofrotating wheel assembly 10, the movement of the part that rotates withwheel assembly 10 is measured with respect to the part that does notrotate with wheel assembly 10. An example of such an encoder is theAvago HEDS-9701.

The Avago HEDS-9701 contains a Light Emitting Diode (LED) having emittedlight collimated into a parallel beam by a collimating lens that ispositioned in the path of the light. Opposite the LED is a set ofphotodetectors and associated the signal processing circuitry thatproduces digital waveforms from light received from the LED. In anembodiment, the LED, collimating lens, photodetectors and signalprocessing circuitry rotate with wheel assembly 10 and the codewheelremains in a fixed spatial relationship to axle 8.

The codewheel is positioned between the LED and the photodetectors. Thecodewheel does not rotate with the wheel assembly 10. Therefore, therelative movement of codewheel with respect to the LED and thephotodetectors causes the light beam to be interrupted by the pattern ofspaces and bars on the codewheel. The photodiodes detect theseinterruptions that are arranged in a pattern. The photodetectors arespaced such that a light period on one pair of photodetectorscorresponds to a dark period on the adjacent pair of photodetectors. Theoutputs from the photodiodes are input into comparators within thesignal processing circuitry that produce final outputs for channels Aand B. The outputs of channel A and channel B are digital signals thatare 90 degrees out of phase, or otherwise stated said to be inquadrature. The counting of number of phases of the spinning codewheelleads to a determination of the velocity of wheel assembly 10. Thesesignals for output channels A and B are input into main circuit board16. The outputs from the A and B channels can be placed within a LUT aswill be discussed in further detail below. Other embodiments can use theoutputs from channels A and B directly in mathematical calculationswithout employing a LUT on main circuit board 16 or place them intomemory on main circuit board 16 and use them directly.

The rotary encoder described above is an example of one specific type ofrotary encoder and it will be readily apparent to those skilled in theart that other rotary encoders could be used. Additionally, other typesof encoders rather than rotary encoders may be used to determine thevelocity of a bike employing wheel assembly 10.

In one embodiment, a configuration of sensors employs an encoder and anaccelerometer.

The accelerometer 14 can be positioned such that is rotates with wheelassembly 10 to measure acceleration intensity. The value of accelerationis read by the electronics together with the encoder 18 reading. Theencoder 18 reading can be initialized by artificially setting to zerowhen the wheel is in a flat surface. Once initialized, the electronicskeeps track of the encoder position and the accelerometer readings. Inan embodiment, the encoder 18 position and accelerometer 14 readings areused by the processor on main circuit board 16 to calculate the speedand position, respectively. The phase angle of the accelerometer can becalculated to provide a measure of the slope. The electronics can alsocalculate the encoder 18 position change is units of time, which is ameasure of the bicycle speed. These two values, of slope and speed canbe compared in real time by the processor on main circuit board 16 toprovide information to generate the corresponding voltage needed by themotor to compensate for the slope and to compensate for the drag due tovelocity.

Other embodiments that employ lookup tables can retrieve data previouslycalculated and placed in look up tables, are compare the valuescontained in look up tables during operation of wheel assembly 10. Theresulting comparisons provide information to generate the correspondingvoltage needed by the motor to compensate for the slope and tocompensate for the drag due to velocity.

As stated above, the algorithm requires that the slope initially be setto zero. Therefore, the user has to calibrate the unit on a flatsurface. In this type of embodiment, the initial slope is calculatedwhen the bicycle starts (and is assumed to be on level ground) is storedand subtracted from the phase angle calculated on subsequent revolutionsafter initialization. Alternatively, an initialization reset mechanismcan be incorporated into wheel assembly 10 allowing a user to indicate astarting point. By incorporating one of more strain gage sensors 28,this initialization step can be eliminated.

In an embodiment, one or more strain gage sensors 28 are located onspokes 24. In embodiments using strain gage sensors 28 located on eachspoke 24, the output from the strain gage sensors 28 reaches a maximumonce the end of spoke near the tire is closest to the ground resultingin the maximum amount of strain on that spoke 24. The resulting FFT ofthe strain gages together with the accelerometer FFT will give the slopewithout any calibration.

In embodiments using a single strain gage sensor 28, the electronicsassociated with the strain gage sensor 28 can calculate a centroid ofthe stress value to identify the placement angle of the wheel assembly.

In an embodiment, a wheatstone bridge amplifier is associated with eachstrain gage sensor 28. In other embodiments, multiple strain gage sensor28 will provide multiple resistance values within a wheatstone bridgecircuit.

FIG. 2 is an illustration of a functional block diagram for anembodiment of wheel assembly 10. The embodiment shown in FIG. 2 is awheel assembly 10 that can operate without the need of any user controland hence requires no user interface. The embodiment in FIG. 2 the wheelassembly provides electronics allowing the user to simply pedal orbrake. The wheel assembly 10 has multiple sensors that providesufficient intelligence to read the slope and the speed of the bicycle.

The sensors in the embodiment for wheel assembly 10 illustrated in FIG.2 include one or more strain gages 28. The strain gages 28 provide asimple and effective initialization for the wheel assembly 10. Eachstrain gage 28 can have a wheatstone bridge amplifier circuit (full,half or quarter) associated with it to provide an indication that theresistance value of that strain gage has changed. A strain gageamplifier 25 can be used to provide excitation for a wheatstone bridgeamplifier circuit and to amplify the strain gage reading.

For embodiments using multiple strain gages on spokes of wheel assembly10, the force exerted by the ground will create a maximum reading forthe strain gage 28 on the spoke 24 closest to ground. These embodimentscan place a strain gage 28 on each spoke 28 to create intelligence thatwill allow the processor 23 on the main circuit board to know theposition of the wheel assembly.

An embodiment includes measuring the slope angle with respect to thegravity by using a single strain gage 28. The strain gage 28 can beconfigured to measure stress in multiple directions. The centroid of thestress can then be used to locate position of the wheel assembly 10.Embodiments employing a single strain gage 28 can be used to determine acentroid of stress levels and in a manner that informs processor 23 onthe main circuit board of the position of the wheel assembly 10.

Analog to Digital convertor (A/D) 19 converts strain gage data intodigital form where it is place on to bus A. The strain gage data canthen be used to by the processor 23.

Encoder 18 provides quadrature signals indicative of the movement ofwheel assembly 10 around axle 8. The signals from encoder 18 can, in anembodiment, be digital signals. Therefore, analog to digital conversionis not required. These quadrature signals are placed onto bus A and usedby processor 23 to calculate the linear velocity at which wheel assembly10 is moving.

In other embodiment, the quadrature signals may be placed into memory onmain circuit board 16 and read out by the processor to calculatevelocity. A Look Up Table (LUT) 27 a via bus A could also be used forthis purpose.

The accelerometer 14 measures forces exerted through movement of wheelassembly 10 as well as forces due to gravity. The accelerometer 14 willproduces voltage outputs responsive to force exerted on theaccelerometer 14. These voltage outputs are the data received andconverted to digital form by A/D 26. The digitized version of theaccelerometer data is then made available to Bus A where it is placedinto array 21. The data from array 18 may be read out periodically byprocessor 23 and a Fast Fourier transform may be made using FFT 20.

In another embodiment, the Fast Fourier Transform of the data fromaccelerometer 14 is placed into Look Up Table (LUT) 27 b via bus A. Thedata located in LUT 27 b can be used by the processor.

Array 21 and FFT 20 can be located in memory on main circuit board 16.Array 21 is an allocation of memory for storage purposes. Instead ofarray 21 being used as a data structure, other data structure such as alinked list could also be used. FFT 20 a program that can reside withinmemory on main circuit board 16.

In embodiments employing LUTs 27 a, 27 b, these can be located in flashmemory on main circuit board 16.

The Fast Fourier Transform of data from accelerometer represents theslope. During initialization, subtracting the phase angle for the straingages from the accelerometer phase angle (e.g. φ_(A)−φ_(S)) gives thesloped angle at which the wheel assembly 10 exits.

In an embodiment, the electronics can employ look up tables (LUT). Theselook up tables 27 a, 27 b may contain accelerometer data as a functionof slope angle and data from strain gages.

In an embodiment, the computer reads the two LUTs 27 a, 27 b dependingon the values of the sensors and combines the values from the LUTs 27 a,27 b to produce a value for the output voltage that is to be output fromthe battery assembly 22 to the motor 12. In this manner the processor onthe main circuit board 16 can compensate for slope and drag force duethe bicycles velocity making the bicycle easier and more enjoyable toride.

Other embodiments may make calculations directly from the sensor and donot require the use of look up tables.

FIG. 3 is a flow diagram showing the basic functioning of thecalculation of slope, velocity and phase angle. The routine is enteredonce wheel assembly 10 is being used. The system for wheel assembly goesthrough an initialization 32 wherein system resources are acquired asneeded and the various parts are initialized. Velocity Detected 33 waitsfor sufficient movement in the wheel assembly before reading any sensordata. In this manner there is 0 volts applied to motor 12 while thebicycle is at a stand still position. Once velocity is detected,parallel branches are taken. Collect Velocity Data 34 is similar to theflow diagram in FIG. 4 and Collect Accelerometer Data is similar to theflow diagram in FIG. 5, may be performed in parallel.

The linear speed of the wheel assembly 10 is determined by CalculateVelocity Data 34. The phase angle for the accelerometer data isdetermined by Perform FFT 36. The Calculate Slope By SubtractingVelocity Phase Angle From Accelerometer Phase Angle 38 give the angle ofinclination to help determine the output voltage that should bedelivered from the battery assembly 22 to the motor 12 by controller 6.

The routine of FIG. 3 then returns to the post initialization state andbegins the routine again.

In an embodiment, an Angle Calculation can be determined to provide thedesired output voltage from the battery assembly 22 to the motor 12 atany given point in time while the bicycle is being ridden. The outputvoltage should be higher if the bicycle is climbing a hill, and lower ifit is travelling on flat ground or going down a hill.

Additionally, the output voltage should be higher if the bicycle istravelling at higher speeds for two reasons: (1) to overcome mechanicaldrag forces that climb with velocity; (2) to overcome the back-emf thatis generated by the motor as it spins faster.

The desired output voltage can be derived from the calculation ofEquation 1.

Output voltage=[(ANGLE*C1)+(VELOCITY*C2)]+C3  Equation 1:

Wherein, ANGLE is the angle of the surface the bicycle is being riddenon, VELOCITY is the linear speed of the bicycle, C1 is the gain appliedto the ANGLE, C2 is the gain applied to the VELOCITY and C3 is an offsetapplied to the whole calculation.

In an embodiment C1, the gain applied to the angle, is 37, with theangle being represented in radians. C2, the gain applied to thevelocity, is 0.42, with the velocity measured in msec. C3, the offsetapplied to the whole calculation, is 0.75 volts. It should be noted thatvarying embodiments may employ different gains C1, C2 and offset C3 andthat the foregoing going is only an example of one of several possibleembodiments.

In an embodiment, ANGLE is updated once per revolution of the wheel. Theupdating of ANGLE can be performed more or less frequently in accordancewith differing embodiments.

In another embodiment, VELOCITY is updated N times per revolution of thewheel. The updating of VELOCITY can be performed more or less frequentlyin accordance with differing embodiments. In an embodiment, the value ofN is 90. The frequency that VELOCITY is updated may vary greatly isaccordance with varying embodiments.

In an embodiment, each time the VELOCITY is updated, data from theaccelerometer 14 can be updated and stored in array within memory onmain board 16. Each revolution of wheel assembly 10, the accelerometerdata in the array can be read out and used to calculate the phase offsetof the accelerometer.

Calculations can be accomplished using the processor 23 on main circuitboard 16.

Data Sources:

The data for calculation of VELOCITY and ANGLE can be obtained from twosources: (1) the accelerometer 14; and (2) the two channel digitalrotary encoder 18 having one part remaining stationary relative to axle8, and another part that rotates with the wheel assembly 10.

Calculation of VELOCITY:

FIG. 4 is a flow diagram for an embodiment that calculates the speed ofwheel assembly 10. Set i=0 41 initializes an indexing variable.Interrupt received 43 waits for an interrupt to the processor on-boardmain circuit board 16. Encoder 18 generates quadrature pulses as thewheel assembly 10 rotates that are used to interrupt the processoron-board main circuit board 16. Encoder 18 generates quadrature pulses Ntimes per revolution of wheel assembly 10. Therefore, the processoron-board main circuit board 16 is interrupted N times per revolution bypulses form the encoder 18, each interrupt triggering an interruptservice routines (ISR). In an embodiment N is 90; however, this numbermay be varied greatly in accordance with varying embodiments.

Each time the ISR is triggered, READ TIMER 43 reads the value of a timeron main circuit board 16. CALCULATE TIME SINCE LAST INTERRUPT 45 storesthe timer value which is the time since the last interrupt. The distancecalculated since the last interrupt is a known value that remainsconstant between encoder pulses. Using the timer reading and the knowndistance VELOCITY=(DISTANCE TRAVELED)/TIMER READING 47 distance byperforms the relationship shown in Equation 2:

VELOCITY=distance traveled between encoder pulses/timer counts  Equation2:

Each time encoder 18 provides pulses that interrupt the process on maincircuit board 16 occurs, the amount of time since the last pulse fromencoder 18 is known (since the last interrupt). In an embodiment, thetimer can have a resolution of 100,000 counts per second. Otherembodiments will have differing timer resolutions, either more countsper second or fewer counts per second. Implicit in each encoder pulse isthat a certain distance has been covered between each pulse. Thisdistance is a constant, making calculation of VELOCITY a simple task.

Once VELOCITY is calculated, RESET TIMER 48 resets the timer to 0. Seti=i+1 increments the indexing variable i that counts of to the value ofN. Once i=N, i<N 42 exists the routine of FIG. 4 because a completerevolution of wheel assembly 16 has been completed and the VELOCITY ofthe wheel assembly 10 calculated.

The VELOCITY dependent portion of the output voltage is thus updated.

In an embodiment, FIG. 4 is not exited but again returns to entry pointA and begins velocity calculations for the next revolution of wheelassembly 10.

Calculation of ANGLE:

In an embodiment, the ANGLE calculation is derived from multiple datasources. These data sources can be a rotary encoder and/or anaccelerometer.

In an embodiment, the ANGLE calculation is updated one time perrevolution of the wheel. Accordingly, in such an embodiment, the dataacquisition and calculations described below with reference to FIG. 5will work in parallel with the data acquisition and calculationsdescribed above in reference to FIG. 4.

In an embodiment, the ANGLE calculation is accomplished in two parts: InPart 1 of the ANGLE calculation, the accelerometer 14 rotates with thewheel assembly 10. Therefore, if the bicycle is rolling at a constantspeed on a smooth surface, gravity causes the output of theaccelerometer 14 to be a sine wave. Analog to Digital (A/D) conversionsare performed on the signal from the accelerometer N times perrevolution. These values are stored in memory on main circuit board 16as an array or linked list. At the completion of a revolution, the datafrom the accelerometer 14 are stored in memory is used to calculate thephase offset of the signal.

Referring to FIG. 5, the angle calculation routine performed by theprocessor on the main circuit board 16 has entry point B. As discussedabove in reference to FIG. 4, SET i=0 initializes an indexing variablethat is used to index the reading of sensor data. READ DIGITIZEDACCELEROMETER DATA 53 acquires sensor data from accelerometer 14. STOREACCELEROMETER DATA IN ARRAY 54 places the acquired sensor data fromaccelerometer 14 into memory on main circuit board 16 such that it canbe accessed as an array. It should be noted that a linked list of eachiteration of the accelerometer data stored read can be created in placeof an array. Additionally, any data structure that allows the access tothe iterations of accelerometer data stored in memory can be used. Seti=i+1 55 increments the indexing variable i. The decision block i<n 56checks the value of indexing variable i. The routine in FIG. 5 willbranch back loop back to READ DIGITIZED ACCELEROMETER DATA 53 SENSORuntil the indexing variable i becomes equal to N.

In an embodiment, the loop described above is performed in parallel withthe velocity calculation described in reference to FIG. 4. Each pulsesfrom encoder 18 interrupt the processor on main circuit board 16, theaccelerometer data is acquired and stored into an array. This continuesthrough an entire revolution of wheel assembly 10 and then begins again.At the completion of a revolution, the data from the accelerometer 14are stored in memory is used to calculate the phase offset of thesignal. At the completion of a revolution, the data from theaccelerometer 14 that has been stored in memory is used to calculate thephase offset of the signal.

In an embodiment, a MatLab implementation is used for the calculation ofthe phase offset signal from the stored accelerometer data. This MatLabimplementation is shown below.

Matlab Implementation of the Angle Calculation

function [ang1,ang2]=angle_calc(y1,N)% Given one input signal, y1 will return phase offset of the signal% assuming y1 is primarily 1 Hz over N samples.% y1 is pendulum signal=A1*cos(2*pi*x+ang1);

% N=90;

x=(0:N−1)/N;basis_pendulum_cos(x)=cos(2*pi*x);basis_pendulum_sin(x)=sin(2*pi*x);a1=0;b1=0;for i=1:N,

a1=a1+y1(i)*basis_pendulum_cos(i);

b1=b1+y1(i)*basis_pendulum_sin(i);

enda1=a1/N;b1=b1/N;a2=a2/N;b2=b2/N;A1=2*sqrt(a1̂2+b1̂2);ang1=a tan 2(−b1,a1).

In another embodiment, the calculation performed in the MatLabimplementation above is performed by a Fast Fourier Transform (FFT). TheFFT can be written in a version of C++, or other high level program toperform the same mathematical computations performed by the foregoingMatLab implementation.

In Part 2 of the ANGLE calculation, accelerometer 14 is employed tosense all acceleration forces, not just gravity. Linear acceleration ofthe bicycle also forms a component of the total acceleration that theaccelerometer measures. In this application, the portion of the anglethat is due to linear acceleration of the bicycle is not a desiredcomponent. To compensate for this, the linear average linearacceleration is calculated from velocity data in accordance with therelationship of Equation 3:

Referring to FIG. 5, CALCULATE PHASE OFFSET FOR ACCELEROMETER 57 ISPERFORMED AT THE END OF A REVOLUTION either using an FFT, MetLabimplementation or other programming solution.

CALCULATE ANGLE DUE TO LINEAR ACCELERATION 58 performs the calculationsdescribed below. First an average linear calculation is made accordingto equation 3:

Average linear acceleration=[(velocity at the end of therevolution)−(velocity at the start of the revolution)]/(time revolutiontakes to occur)  Equation 3:

The result from Equation 3 is multiplied by a constant to put it ingravitational units (G's) of 9.81 m/s².

The portion of the angle due to linear acceleration is then calculatedaccording to the relationship of Equation 4:

Apparent_angle=a tan(average linear acceleration)  Equation 4:

SUBTRACT ANGLE FROM PHASE OFFSET 59 subtract The Apparent_angle from theangle calculated in Part 1, resulting in the angle that is used tocalculate output voltage.

In an embodiment, if the final calculated angle is outside of the rangeof +/−7 degrees, it is clipped to +/−7 degrees using logic implementedwithin the system software that performs the following:

If (angle > 7 degrees) {  Angle = 7 degrees } If (angle < −7 degrees) {Angle = − 7 degrees }

Further Calculations:

To reduce the affect of noise sources, a running average is used for theangle calculation as shown by the following relationship of Equation 4:

Angle applied for this revolution=Average of the angles calculated forthe previous n revolutions (The optimal value of n is still beingdetermined. But as of this writing, n=4)  Equation 4:

A linear interpolation is performed between the previous angle and thecurrent angle, resulting in an entire revolution to change between thetwo angles. This insures that there are no abrupt changes in voltage atwheel rotation boundaries.

An example of the interpolation:

Assume that the new angle has been calculated as described above, andthe previous angle is also known.

Assume the following values:

angle (rev n−1)=1 degreeangle (rev n)=2 degreesAssume each rev is broken up into 90 stepsAt each step, 1/90th of the difference in angle is applied to the wheel.In our example, the difference in angle is 2 degrees−1 degree=1 degree.1/90th of 1 degree=0.0111

TABLE 1 interrupt number applied angle 1 1 2 1.0111 3 1.0222 4 1.0333 .. . . . . 87 1.9667 88 1.9778 89 1.9889 90 2.000

As shown in Table 1, an entire revolution of the wheel is used to applythe angle change, avoiding abrupt changes in voltage to the motor.

The foregoing describes embodiment of the invention for illustrativepurposes. These embodiments should not be viewed as being limiting andthe breadth of the invention should be measured by the appended claims.

1. A wheel assembly comprising: a motor attached to an axle within saidwheel assembly; a battery system within said wheel assembly that isconfigured to deliver power to said motor; a sensor system within saidwheel assembly that provides analog data related to velocity and angleof orientation of said wheel assembly; and a control system within saidwheel assembly that receives analog data related to velocity and angleof orientation for said wheel assembly from said sensor system, saidcontrol system having at least one output to said battery systemindicative of an amount of power that is delivered to said motor.
 2. Thewheel assembly of claim 1 wherein said output of said control systemcontrols said amount of power delivered to said motor without any userinput.
 3. The wheel assembly of claim 1 wherein said control systemfurther comprises: at least one analog to digital convertor thatreceives analog data related to velocity and angle of orientation forsaid wheel assembly from said sensor system and converts the analog datarelated to velocity and angle of orientation for said wheel assemblyinto digital data related to velocity and angle of orientation for saidwheel assembly; an algorithm that receives digital data related tovelocity and angle of orientation for said wheel assembly, saidalgorithm comprising: a first function for determining angle oforientation for said wheel assembly; a second function for determiningvelocity of said wheel assembly; a determination of output voltageapplied to said motor via said output to said battery system, saiddetermination performed according to:OUTPUT VOLTAGE=ANGLE*C1+VELOCITY*C2+C3 wherein, ANGLE is the angle oforientation for said wheel assembly; VELOCITY is the velocity of saidwheel assembly; C1 is gain applied to ANGLE, C2 is gain applied toVELOCITY and C3 is a voltage offset; and a control device associatedsaid battery system, said control device receiving said determinationand applying said determination of OUTPUT VOLTAGE to said batterysystem.
 4. The wheel assembly of claim 3 wherein said control systemfurther comprises a Fast Fourier Transform (FFT) of digital data relatedto velocity and angle of orientation for said wheel assembly, said FFTof digital data related to velocity and angle of orientation for saidwheel assembly being stored in a pair of Look Up Tables (LUTs) and thedetermination of OUTPUT VOLTAGE is made by subtracting the stored FFTrelated to velocity from the stored FFT related to the angle oforientation for said wheel assembly.
 5. The wheel assembly of claim 4wherein the stored FFT related to velocity and the stored FFT related tothe angle of orientation for said wheel assembly selected in thedetermination of OUTPUT VOLTAGE is made by sensor data.
 6. The wheelassembly of claim 5 wherein said first function for determining angle oforientation for said wheel assembly and said second function fordetermining velocity of said wheel assembly are performed in parallel.7. The wheel assembly of claim 1 wherein said sensor system furthercomprises a rotary an encoder to provide analog data related tovelocity.
 8. The wheel assembly of claim 1 wherein said sensor systemfurther comprises an accelerometer to provides analog data related angleof orientation of said wheel assembly.
 9. The wheel assembly of claim 1wherein said sensor system further comprises a least one strain gage.10. The wheel assembly of claim 9 wherein said strain gage provide aninitial determination of orientation of said wheel assembly.
 11. A wheelassembly comprising: a motor attached to an axle within said wheelassembly such that said motor powers said wheel assembly to rotate aboutsaid axle once said motor receives a predetermined amount of power; abattery system within said wheel assembly that is configured to deliverpower to said motor, said battery system arranged to rotate with saidwheel assembly; a sensor system within said wheel assembly that providesanalog data related to velocity and angle of orientation of said wheelassembly; and a control system within said wheel assembly that receivesanalog data related to velocity and angle of orientation for said wheelassembly from said sensor system, said control system having at leastone output to said battery system indicative of an amount of power thatis delivered to said motor.
 12. The wheel assembly of claim 11 whereinsaid output of said control system controls said amount of powerdelivered from said battery system to said motor in response to inputsfrom said sensor system.
 13. The wheel assembly of claim 12 wherein saidcontrol system further comprises: at least one analog to digitalconvertor that receives analog data related to velocity and angle oforientation for said wheel assembly from said sensor system and convertsthe analog data related to velocity and angle of orientation for saidwheel assembly into digital data related to velocity and angle oforientation for said wheel assembly; an algorithm that receives digitaldata related to velocity and angle of orientation for said wheelassembly, said algorithm comprising: a first function for determiningangle of orientation for said wheel assembly; a second function fordetermining velocity of said wheel assembly; a determination of outputvoltage applied to said motor via said output to said battery system,said determination performed according to:OUTPUT VOLTAGE=ANGLE*C1+VELOCITY*C2+C3 wherein, ANGLE is the angle oforientation for said wheel assembly; VELOCITY is the velocity of saidwheel assembly; C1 is gain applied to ANGLE, C2 is gain applied toVELOCITY and C3 is a voltage offset; and a control device associatedsaid battery system, said control device receiving said determinationand applying said determination of OUTPUT VOLTAGE to said batterysystem.
 14. The wheel assembly of claim 13 wherein said control systemfurther comprises a Fast Fourier Transform (FFT) of digital data relatedto velocity and angle of orientation for said wheel assembly, said FFTof digital data related to velocity and angle of orientation for saidwheel assembly being stored in a pair of Look Up Tables (LUTs) and thedetermination of OUTPUT VOLTAGE is made by subtracting the stored FFTrelated to velocity from the stored FFT related to the angle oforientation for said wheel assembly.
 15. The wheel assembly of claim 14wherein the stored FFT related to velocity and the stored FFT related tothe angle of orientation for said wheel assembly selected in thedetermination of OUTPUT VOLTAGE is made by sensor data.
 16. The wheelassembly of claim 5 wherein said first function for determining angle oforientation for said wheel assembly is performed every revolution ofsaid wheel assembly and said second function for determining velocity ofsaid wheel assembly is performed in parallel with said first function.17. The wheel assembly of claim 16 wherein said sensor system furthercomprises a rotary an encoder to provide analog data related to velocitythat interrupting a system processor to update velocity data.
 18. Thewheel assembly of claim 17 wherein said sensor system further comprisesan accelerometer to provides analog data related angle of orientation ofsaid wheel assembly.
 19. The wheel assembly of claim 18 wherein saidsensor system further comprises a least one strain gage.
 20. The wheelassembly of claim 19 wherein said strain gage provide an initialdetermination of orientation of said wheel assembly.